package dome1;

public enum TestEnum {
    RED(0 , "RED") , YELLOW(1 , "YELLOW") , GREEN(2 , "GREEN");

    //属性成员
    public int val ;
    public String color ;

    private TestEnum(int val , String color) {
        this.val = val;
        this.color=color;
    }

    public static void main(String[] args) {
//        dome1.TestEnum[] testEnum = dome1.TestEnum.values();
//        for (int i = 0; i < testEnum.length; i++) {
//            System.out.println(testEnum[i] +"  " +testEnum[i].ordinal());
//        }
        System.out.println(TestEnum.YELLOW.ordinal());
    }
}

